package com.fosun.spr.plugin.uuc.api.uucCommonRemote.control;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.fosun.spr.core.base.CoBaseControl;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.UucCommonRemoteService;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.model.ListMenuSpModel;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.model.ListMenuSrModel;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.model.ListPrivilegeSpModel;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.model.ListPrivilegeSrModel;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.model.ListRoleSpModel;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.model.ListRoleSrModel;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.model.ListUserSpModel;
import com.fosun.spr.plugin.uuc.api.uucCommonRemote.service.model.ListUserSrModel;

@RestController
public class UucCommonRemoteControl extends CoBaseControl {
	@Resource
	private UucCommonRemoteService uucCommonRemoteService;

	/**
	 * http://127.0.0.1:8081/api/uucCommonRemote/listPrivilege
	 * 
	 * @param request
	 * @param spModel
	 * @return
	 */
	@RequestMapping(value = "/api/uucCommonRemote/listPrivilege", method = RequestMethod.GET)
	public ListPrivilegeSrModel listPrivilege(HttpServletRequest request, ListPrivilegeSpModel spModel) {
		// SessionUtils.fillSpModel(request, spModel);
		ListPrivilegeSrModel srModel = uucCommonRemoteService.listPrivilege(spModel);
		return srModel;
	}

	/**
	 * http://127.0.0.1:8080/spr_boot_demo/api/uucCommonRemote/listMenu
	 * http://127.0.0.1:8081/api/uucCommonRemote/listMenu
	 * 
	 * @param request
	 * @param spModel
	 * @return
	 */
	@RequestMapping(value = "/api/uucCommonRemote/listMenu", method = RequestMethod.GET)
	public ListMenuSrModel listMenu(HttpServletRequest request, ListMenuSpModel spModel) {
		// SessionUtils.fillSpModel(request, spModel);
		ListMenuSrModel srModel = uucCommonRemoteService.listMenu(spModel);
		return srModel;
	}

	/**
	 * http://127.0.0.1:8080/spr_boot_demo/api/uucCommonRemote/listUser
	 * http://127.0.0.1:8081/api/uucCommonRemote/listUser
	 * 
	 * @param request
	 * @param spModel
	 * @return
	 */
	@RequestMapping(value = "/api/uucCommonRemote/listUser", method = RequestMethod.GET)
	public ListUserSrModel listUser(HttpServletRequest request, ListUserSpModel spModel) {
		// SessionUtils.fillSpModel(request, spModel);
		ListUserSrModel srModel = uucCommonRemoteService.listUser(spModel);
		return srModel;
	}

	/**
	 * http://127.0.0.1:8080/spr_boot_demo/api/uucCommonRemote/listRole
	 * http://127.0.0.1:8081/api/uucCommonRemote/listRole
	 * 
	 * @param request
	 * @param spModel
	 * @return
	 */
	@RequestMapping(value = "/api/uucCommonRemote/listRole", method = RequestMethod.GET)
	public ListRoleSrModel listRole(HttpServletRequest request, ListRoleSpModel spModel) {
		// SessionUtils.fillSpModel(request, spModel);
		ListRoleSrModel srModel = uucCommonRemoteService.listRole(spModel);
		return srModel;
	}
}
